<cfif structKeyExists(url,"order")>
	<cfinclude template="view.cfm">
	<cfabort>
<cfelse>
	<cfquery name="get_orders" datasource="#DSN1#">
		select	*
		FROM		customer_orders, customers, ref_order_status
		where		customers.customer_id=customer_orders.customer_id
		and			customer_orders.order_status_code=ref_order_status.order_status_code
		order by 	order_placed_datetime desc
	</cfquery>
	<cfhtmlhead text="<title>#ApplicationName# | ADMIN | ORDERS</title>">
	<cfoutput>
		<style type="text/css" title="currentStyle">
			@import "https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/css/jquery.dataTables.css";
		</style>
		
		<script type="text/javascript" language="javascript" src="https://ajax.aspnetcdn.com/ajax/jquery.dataTables/1.9.0/jquery.dataTables.js"></script>
		<script type="text/javascript" charset="utf-8">
			$(document).ready(function() {
				$('##dataset').dataTable();
			} );
		</script>
		<h1>Orders (#get_orders.recordCount#)</h1>
	<table cellpadding="0" cellspacing="0" border="0" class="display" id="dataset" width="100%">
		<thead>
			<tr>
				<th width="20%" align="left">Order Date/Time:</th>
				<th width="20%" align="left">Order ##:</th>
				<th width="20%" align="left">Status:</th>
				<th>Name:</th>
			</tr>
		</thead>
		<tbody>
			<cfloop query="get_orders">
				<tr>
					<td align="left"><a href="https://www.denveryarddog.com/admin/Orders/?order=#order_id#">#DateFormat(order_placed_datetime, "yyyy-mm-dd")# #TimeFormat(order_placed_datetime, "hh:mm tt")#</a></td>
					<td align="left"><a href="https://www.denveryarddog.com/admin/Orders/?order=#order_id#">#order_id#</a></td>
					<td align="left"><a href="https://www.denveryarddog.com/admin/Orders/?order=#order_id#">#order_status_description#</a></td>
					<td align="left"><a href="https://www.denveryarddog.com/admin/Orders/?order=#order_id#">#customer_name#</a></td>
				</tr>
			</cfloop>
		</tbody>
		<tfoot>
			<tr>
				<th width="20%" align="left">Order Date/Time:</th>
				<th width="20%" align="left">Order ##:</th>
				<th width="20%" align="left">Status:</th>
				<th>Name:</th>
			</tr>
		</tfoot>
	</table>
	</cfoutput>
</cfif>
